extends Area2D

@onready var timer = $Timer

func _on_body_entered(body):
	print('death')
	Engine.time_scale = 0.5
	body.get_node("CollisionShape2D").queue_free()
	timer.start()

func _on_timer_timeout():
	Engine.time_scale = 1.0
	if get_tree().current_scene != null:
		get_tree().reload_current_scene()
	else:
		get_tree().current_scene = get_tree().get_root().get_node("Level01")
		get_tree().reload_current_scene()
